#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "facecat/stdafx.h"
#include <QMainWindow>
#include <QPainter>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QKeyEvent>
#include <QLineEdit>
#include "Win32/QtHost.h"
#include "Win32/QtPaint.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
private:
    Ui::MainWindow *ui;
public:
    QtHost *m_host;
    FCNative *m_native;
    QtPaint *m_paint;
    QLineEdit *m_textBox;
    FCView *m_editingTextBox;
    double m_scaleFactor;
    int m_buttons;
    int m_clicks;
    void paintEvent(QPaintEvent *event) override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseDoubleClickEvent(QMouseEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;
    void keyReleaseEvent(QKeyEvent *event) override;
    void wheelEvent(QWheelEvent *event) override;
    void onLoad();
    void resetScaleSize(FCSize clientSize);
    void showTextBox(FCView *view, FCView *lastView);
    void hideTextBox(FCView *view);
};

#endif // MAINWINDOW_H
